home *** CD-ROM | disk | FTP | other *** search
/ Beginning Mac Programming / Beginning Mac Programming.bin / Open Me for REALbasic 3 / REALbasic 3.2 / Example Projects / Reusable Classes_Code / User Interface / CBetterPopupMenu 1.5 / Readme_Manual (really) < prev   
Text File  |  2000-02-21  |  4KB  |  115 lines

  1. CBetterPopupMenu 1.5
  2.  
  3. REALbasic custom class
  4. by Fabian Lidman, fabian@kagi.com
  5. http://home.swipnet.se/~w-42040/rb.html
  6.  
  7. CBetterPopupMenu is a canvas-based custom class for REALbasic 2.1 or higher. It gives you a popupmenu control that can have two appearances; the white system7-styled one, and a nice bevelled one. There have been some classes that do this before, but they have required expensive third-party plugins. CBetterPopupMenu is 100% REALbasic code. No plugins are used.
  8. This class is free. However, if you use it, give me credit (that is, mention me in the about box).
  9.  
  10.  
  11. V e r s i o n   H i s t o r y
  12.  
  13. • Version 1.1  added the ability to specify the TextFont and TextSize of the control.
  14.  
  15. • Version 1.2  fixed a bug that caused the menubar to go mad when the control used another font than System 12.
  16.  
  17. • Version 1.5  fixed a bug causing empty controls to crash, removed the need to manually set the MenuID property, and added support for the standrad MacOS popupmenu look.
  18.  
  19.  
  20. H o w   T o   U s e
  21.  
  22. Important - In CBetterPopupMenu 1.5, you no longer need to set the menu id manually - this is handled automatically by the control.
  23.  
  24. To decide which appearance the control should have, set the Style property in the Open event. A value of 0 (default) gives a bevel style popupmenu, and the value 1 gives a System 7 (b/w) one. The value 2 gives a control looking very similar to the default popup menu.
  25.  
  26.  
  27. A d d i n g  &  D e l e t i n g   R o w s
  28.  
  29. These are the methods and functions you use to add and delete rows to the PopupMenu.
  30.  
  31. AddRow(text as string)
  32. adds a row to the popupmenu.
  33.  
  34. InsertRow(position as integer, text as string)
  35. inserts a row after the row specified by the position parameter.
  36.  
  37. RemoveRow(n as integer)
  38. removes the row specified by the n parameter.
  39.  
  40. DeleteAllRows()
  41. deletes all rows from the menu.
  42.  
  43. AddSeparator()
  44. adds a separator line to the menu.
  45.  
  46. ListCount() as integer
  47. returns the number of rows in the menu.
  48.  
  49. ListIndex() as integer
  50. returns the number of the currently selected item.
  51.  
  52.  
  53. M a n i p u l a t i n g   R o w   T e x t
  54.  
  55. These are the methods and functions you use to get and set the text of the rows in the popupmenu.
  56.  
  57. List(n as integer) as string
  58. returns the text of row number n.
  59.  
  60. SetList(n as integer, text as string)
  61. sets the text of row number n to text.
  62.  
  63. Text() as string
  64. returns the text of the currently selected item.
  65.  
  66. SetText(text as string)
  67. sets the text of the currently selected item.
  68.  
  69.  
  70. E n a b l i n g   &   D i s a b l i n g   R o w s
  71.  
  72. These are the methods and functions you use to Enable and Disable rows in the menu.
  73.  
  74. EnableRow(row as integer)
  75. enables the row specified by the row parameter.
  76.  
  77. DisableRow(row as integer)
  78. disables the row specified by the row parameter.
  79.  
  80.  
  81. M a n i p u l a t i n g   R o w   S t y l e
  82.  
  83. These are the methods and functions you use to change the style of the rows in the menu.
  84.  
  85. SetRowBold(row as integer, on as boolean)
  86. if the on parameter is true, this method applies bold style to the row specified, else it removes eventual boldness.
  87.  
  88. SetRowItalic(row as integer, on as boolean)
  89. if the on parameter is true, this method applies italic style to the row specified, else it removes eventual italicness.
  90.  
  91. SetRowUnderline(row as integer, on as boolean)
  92. if the on parameter is true, this method applies underline style to the row specified, else it removes eventual underlinity.
  93.  
  94. RowBold(row as integer) as boolean
  95. returns true if the row specified has a bold style.
  96.  
  97. RowItalic(row as integer) as boolean
  98. returns true if the row specified has an italic style.
  99.  
  100. RowUnderline(row as integer) as boolean
  101. returns true if the row specified has an underlined style.
  102.  
  103.  
  104. M a n i p u l a t i n g   I c o n s   &   C h e c k m a r k s
  105.  
  106. These are the methods and functions you use to set the icon of menu rows, and to set checkmarks in the menu.
  107.  
  108. CheckRow(row as integer, checked as boolean)
  109. if the checked property is true, this method checks the row specified, else it unchecks it.
  110.  
  111. SetRowIcon(row as integer, cicn_ID as integer)
  112. puts a color icon ("cicn") in the row specified. The cicn_ID parameter must contain the ID of a "cicn" resource in the application resource fork. Also, the id of the resource must be over 256.
  113.  
  114. RemoveRowIcon(row as integer)
  115. removes the icon of the row specified.